<cfif IsUserInRole("Super User") or IsUserInRole("Regional Admin")>
	<cfinclude template="#request.pathToUI#/grids/users.cfm" />
<cfelse>
	<div class="row">
		<div class="banner prepare-banner">
			<div class="banner-text">
				<span class="banner-header">Users</span><br />
			</div>
		</div>
	</div>
	<div class="row body-row">
		<div class="span3">
			<ul class="nav nav-tabs nav-stacked sidenav">
				<li><a href="#best-practices">Best Practices</a></li>
				<li><a href="#users">Users</a></li>
			</ul>
		</div>
		<div class="span9 content">
		
			<section id="best-practices">
				<h3>Best Practices</h3>
				<p>User accounts give access to this site, the Cash for College Workshop Management System. There are two account types - Organizer and Site Contact.</p>
				<p>Organizers can perform all major operations including:</p>
				<ul>
					<li>Register and launch workshops</li>
					<li>Place orders</li>
					<li>Register volunteers</li>
					<li>Process follow up requests</li>
					<li>Create and approve users</li>
					<li>Update organization information</li>
				</ul>
				<p>Site Contacts are listed as the primary contact for their assigned workshops and able to perform a limited set of workshop-related operations including:</p>
				<ul>
					<li>Launch workshops</li>
					<li>Monitor exit survey completion</li>
					<li>Process follow up requests</li>
				</ul>
				<p>In general, Organizers have managerial access within their organization and Site Contact have access to their assigned workshops.</p>
			</section>
			
			<section id="users">
				<h3>Users</h3>
				
				<p><a href="?view=editUser&User_ID=0" class="btn btn-success">New User</a></p>
				
				<cfscript>
					userGateway = new assets.calgrants.com.gateway.UserGateway();
					users = userGateway.query(regionIDs = IIf(IsUserInRole("Regional Admin"), request.authUser.regionID, ""), Organization_ID = IIf(IsUserInRole("Organizer") OR IsUserInRole("Site Contact"), request.authUser.organizationID, ""));
				</cfscript>
				
				<cfif users.RecordCount gt 0>
				
					<table class="table table-striped table-bordered">
						<thead>
							<tr>
								<th>Name</th>
								<th>Role</th>
								<th>E-mail</th>
								<th>Status</th>
								<th class="action"></th>
							</tr>
						</thead>
						<tbody>
							<cfoutput query="users">
								<tr>
									<td>#First_Name# #Last_Name#</td>
									<td>#Role#</td>
									<td><a href="mailto:#Email#">#Email#</a></td>
									<td>
										<cfif Deleted>
											<font color="red">Deleted</font>
										<cfelseif Archived>
											<font color="silver">Archived</font>
										<cfelseif NOT Approved>
											<font color="orange">Not Approved</font>
										<cfelseif Approved>
											Approved
										</cfif>
									</td>
									<td><a href="?view=editUser&returnView=#view#&User_ID=#User_ID#" class="btn btn-success btn-block">Edit</a></td>
								</tr>
							</cfoutput>
						</tbody>
					</table>
					
				<cfelse>
					<div class="alert alert-info notFound">No users</div>
				</cfif>

			</section>
		</div>
	</div>

</cfif>